package com.trs.jenkinsdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: Chenxiao
 * @Date: 2022-08-01 21:48
 * @Description: AppController
 */

@Controller
public class AppController {
    @RequestMapping(value = {"/","index.html","/demo/index.html"})
    public String index(Model model){
        // 传值
        String msg = "Welcome to Thymeleaf Template";
        // adding the attribute(key-value pair)
        model.addAttribute("message", msg);
        // returning the view name
        return "index";
    }
}
